package com.scy.java.object.dt;

public class MyRectangle extends GeometricObject{
    private double width;//宽
    private double height;//高
//  全参构造器
    public MyRectangle(String color, double weight, double width, double height) {
        super(color, weight);
        this.width = width;
        this.height = height;
    }
    //计算矩形面积的方法
    @Override
    public double findArea() {
        return width*height;
    }

    public double getWidth() {
        return width;
    }

    public void setWidth(double width) {
        this.width = width;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }
}

